// house_pkg/pages/room/index.ts
Page({
  goForm(ev) {
    // console.log(ev.mark.rooms);
    wx.navigateTo({
      url: `/house_pkg/pages/form/index?room=${ev.mark.room}&point=${this.data.point}&building=${this.data.building}`
    })
  },
  onLoad({point,building}){
    this.setData({
      point,building
    })
    this.fake()
  },
  	// 伪造房间号数据（仅用于授课）
    fake() {
      const rooms = []
      // 假设每栋楼都是 5 层
      for (let i = 0; i < 10; i++) {
        // 101 102 201 202 ...
        // 楼层
        const floor = Math.floor(i / 2) + 1
        // 房间
        const num = i % 2 + 1
        const room = [floor, 0, num].join('')
        rooms.push(room)
      }
      // 将房间号存入 data
      this.setData({ rooms })
    }
})